package org.dreamwork.jasmine2.restful.client.gui.ui;

import javax.swing.*;
import javax.swing.tree.DefaultTreeCellRenderer;

/**
 * Created by IntelliJ IDEA.
 * User: seth.yang
 * Date: 2014/12/10
 * Time: 0:48
 */
public class TreeNodeUI extends DefaultTreeCellRenderer {
    private static Icon icon;

    @Override
    public Icon getDefaultLeafIcon () {
        if (icon == null) {
            String path = "org/dreamwork/jasmine2/restful/client/gui/images/plug_fav_16.png";
            ClassLoader loader= TreeNodeUI.class.getClassLoader ();
            icon = new ImageIcon (loader.getResource (path));
        }
        return icon;
    }

    @Override
    public Icon getLeafIcon () {
        return icon;
    }
}